//
//  chatInputView.m
//  SoundPill
//
//  Created by 宋旭东 on 16/3/8.
//  Copyright © 2016年 宋旭东. All rights reserved.
//

#import "chatInputView.h"
#import "UIViewExt.h"
@implementation chatInputView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor blackColor];
        [self createSubviews];
    }
    return self;
}
- (void)createSubviews
{
    self.textview = [[UITextView alloc] initWithFrame:CGRectZero];
    _textview.font = [UIFont systemFontOfSize:15];
    _textview.backgroundColor = [UIColor whiteColor];
    [self addSubview:_textview];
    
    self.sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:_sendBtn];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    
    _textview.frame = CGRectMake(10, 7, self.width - 30 - 60, self.height - 14);
    _sendBtn.frame = CGRectMake(_textview.right + 10, 10, self.width - _textview.right - 20, self.height - 20);
    [_sendBtn setTitle:@"发送" forState: UIControlStateNormal];
    _sendBtn.layer.borderColor = [[UIColor whiteColor] CGColor];
    _sendBtn.layer.borderWidth = 2;

}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
